User Post

[Dev] Why '...' makes trouble (Solved!)

Last edited by disfordave on 16/05/2026, 16:11:32 UTC

User:disfordave / [Dev] Why '...' makes trouble (Solved!)

disfordave

Role: ADMIN

Status: Active

Joined on 25/02/2026, UTC

Contents

Update: Solved!

So this is a technical error that Next.js consistently throws... and I need to understand what is the actual problem

 ⨯ TypeError: Invalid character in header content ["x-action-redirect"]
    at q.setHeader (.next/server/chunks/ssr/_d6cb165a._.js:1:5545)
    at async h (.next/server/chunks/ssr/_5ef73f50._.js:1:8849) {
  code: 'ERR_INVALID_CHAR'
}
 ⨯ TypeError: Invalid character in header content ["x-action-redirect"]
    at q.setHeader (.next/server/chunks/ssr/_d6cb165a._.js:1:5545)
    at async h (.next/server/chunks/ssr/_5ef73f50._.js:1:8849) {
  code: 'ERR_INVALID_CHAR'
}

So it's not server api error. it's more about how next.js handling its server side redirection

Turns out, it looks very much fine on dev server. And even more interesting thing is… the [] itself is not a problem, rather it triggers error only when the title is started with [] characters.

Now, I tried with the title that starts with '[Dev]’. It was not a problem when I tried it on my dev environment, but on production…

Wait… why it suddenly does not throw any error right now????

Anyone know what went wrong with my code? Sorry for my spaghetti but I need your help 😭 GitHub Repo

Known issues

Solved!

It was the sneeky single three dots unicode issue ... and … are different and the later throws the error OMG.

I just changed the title directly on PostgreSQL (to save the revision db, sry this main db is also my labs) and it works perfectly.

I would like to thank my dear coding friend ChatGPT, for noticing that sneeky three single dot thing!

Apple iPhone has a built in feature that automatically change the three dots to one unicode. So now it's time to prevent this edge case.

title = title.replaceAll('…', '...');

This code will solve the problem of accidental input of single three dots unicode!

Update (11/11/2025)

  • 한국어 <- This kind of korean alphabet text also makes Next.js throws the same error. It is gonna be fine for English wiki but for other languages, it would be a total nightmare, and there should be a genuine solution to handle this gracefully.

To be clear, this apparently only happens when it comes to do redirection right inside use server functions hmmm 🤔

Solved! (Again, kind of...)

I was an idiot, yes, it's all about ASCII code (But i still don't know why it can handle Québec tho, it's unusual, but still, it would be better to have a custom safe redirection logic!)

Thanks ChatGPT and Claude for code draft and final checks!

Backlinks (0)
  • General

      No backlinks yet.

  • User

      No backlinks yet.

  • Redirects

      No backlinks yet.

  • Media

      No backlinks yet.

  • Categories

      No backlinks yet.

Categories (0)

    No categories assigned to this page.

Edit Level

> User's own page (User:disfordave and admins only)

Text content on User: pages and its subpages is not licensed under the same terms as regular wiki pages. All rights reserved.